<div class="box box-default">
    <div class="box-body">
        <form class="form-inline">
            <div class="box box-default">
                <div class="form-group col-lg-12 col-md-12 col-sm-12 col-xs-12" style="padding-left:0px !important;">
                    <button class="btn btn-primary" type="button" (click)="showAddOreditModal(1)">
                        <i class="fa fa-edit"></i>添加</button>
                    <button type="button" class="btn btn-box-tool pull-right" data-widget="collapse">
                        <i class="fa fa-minus"></i>
                    </button>
                </div>
                <div class="box-body" style="display:block;">
                    <div class="form-group" style="margin-top:10px !important;padding-left:5px !important;">
                        <label class=" control-label">字典名称：</label>
                        <input type="text" class="form-control" id="" [(ngModel)]="getDictionaryPost.sItemDec" name="sItemDec" placeholder="请输入字典名称">
                        <label class=" control-label">字典编码：</label>
                        <input type="text" class="form-control" id="" [(ngModel)]="getDictionaryPost.sItemCode" name="sItemCode" placeholder="请输入字典编码">
                        <label class=" control-label">字典值：</label>
                        <input type="text" class="form-control" id="" [(ngModel)]="getDictionaryPost.sItemValue" name="sItemValue" placeholder="请输入字典值">
                        <button type="button" class="btn btn-primary" (click)="getDictionaryVal()">
                            <i class="fa fa-search"></i>查询</button>
                    </div>
                </div>
            </div>
        </form>
        <div style="overflow-x:scroll;width:100%">
            <table id="list_table" class="table table-bordered table-keep-line table-hover table-striped" style="margin-top:10px;">
                <thead>
                    <tr>
                        <th class="width-10" (click)="orderData('sItemDec')">字典名称<i class="fa fa-sort"></i></th>
                        <th class="width-15" (click)="orderData('sItemCode')">字典编码<i class="fa fa-sort"></i></th>
                        <th class="width-15" (click)="orderData('sItemValue')">字典值<i class="fa fa-sort"></i></th>
                        <th class="width-10" (click)="orderData('sItemKey')">字典值编码<i class="fa fa-sort"></i></th>
                        <th class="width-10" (click)="orderData('sSortNo')">排序<i class="fa fa-sort"></i></th>
                        <th class="width-20" (click)="orderData('sRemark')">备注<i class="fa fa-sort"></i></th>
                        <th class="width-20">操作</th>
                    </tr>
                </thead>
                <tbody>
                    <tr *ngFor="let item of dictionaryList;">
                        <td class="short_name" [attr.title]="item.sItemDec" (dblclick)="showAddOreditModal(2,item)">{{item.sItemDec}}</td>
                        <td class="short_name" [attr.title]="item.sItemCode" (dblclick)="showAddOreditModal(2,item)">{{item.sItemCode}}</td>
                        <td class="short_name" [attr.title]="item.sItemValue" (dblclick)="showAddOreditModal(2,item)">{{item.sItemValue}}</td>
                        <td class="short_name" [attr.title]="item.sItemKey" (dblclick)="showAddOreditModal(2,item)">{{item.sItemKey}}</td>
                        <td class="short_name" [attr.title]="item.sSortNo" (dblclick)="showAddOreditModal(2,item)">{{item.sSortNo}}</td>
                        <td class="short_name" [attr.title]="item.sRemark" (dblclick)="showAddOreditModal(2,item)">{{item.sRemark}}</td>
                        <td>
                            <a class="btn-xs btn-primary" (click)="showAddOreditModal(2,item)">
                                <i class="fa fa-edit" title="编辑"></i>编辑</a>
                            <a class="btn-xs btn-primary" (click)="delDictionary(item)">
                                <i class="iconfont icon-iconzhenghe62" title="删除"></i>删除</a>
                            <!-- <a class="btn-xs btn-primary" (click)="delDictionary(item)">
                <i class="iconfont icon-iconzhenghe62" title="删除"></i>删除</a> -->
                        </td>
                    </tr>
                </tbody>
            </table>
        </div>
        <div class="box-footer clearfix">
            <app-pagination [currentPageNum]="dictionaryListPageInfo.currentPageNum" [pagesShow]="" [totalPages]="dictionaryListPageInfo.totalPages"
                (pageChanged)="dictionaryPageNavigation($event)">
                <div class="pull-left pagination-detail" data-pagination-additional="true">
                    <span class="pagination-info">
                        当前显示第{{dictionaryListPageInfo.startRow}}到第{{dictionaryListPageInfo.endRow}}条，总共{{dictionaryListPageInfo.total}}条，
                    </span>
                    <span class="page-list">
                        每页记录
                        <span class="btn-group dropup">
                            <button type="button" class="btn btn-default dropdown-toggle" data-toggle="dropdown">
                                <span class="page-size">{{dictionaryListPageInfo.pageSize}}</span>
                    <span class="caret"></span>
                    </button>
                    <ul class="dropdown-menu" role="menu">

                        <li *ngFor="let i of dictionaryListPageInfo.pageList" role="menuitem" [class.active]="dictionaryListPageInfo.pageSize === i"
                            (click)="dictionarypageSizeChange(i)">
                            <a>{{i}}</a>
                        </li>
                    </ul>
                    </span>
                    条
                    </span>
                </div>
            </app-pagination>
        </div>
    </div>
</div>



<div class="modal" id="add-dictionary">
    <div class="modal-dialog modal-lg">
        <div class="modal-content">
            <div class="modal-header">
                <button type="button" class="close" data-dismiss="modal" aria-label="Close">
                    <span aria-hidden="true">&times;</span>
                </button>
                <h4 class="modal-title" *ngIf="ifEdit == 1">新增</h4>
                <h4 class="modal-title" *ngIf="ifEdit == 2">编辑</h4>
            </div>
            <form class="form-horizontal" #dictionaryForm="ngForm">
                <div class="modal-body">

                    <div class="form-group">
                        <label class="col-lg-2 text-right">
                            <span class="span-style">*</span>字典编码:</label>
                        <div class="col-lg-3">
                            <input class="form-control form-fields" type="text" maxlength="64" [(ngModel)]="editOrAddDictionaryPost.sItemCode" name="sItemCode">
                        </div>
                        <label class="col-lg-2 text-right">排序:</label>
                        <div class="col-lg-3">
                            <input class="form-control form-fields" type="text" maxlength="64" [(ngModel)]="editOrAddDictionaryPost.sSortNo" name="sSortNo">
                        </div>
                    </div>
                    <div class="form-group">
                        <label class="col-lg-2 text-right">
                            <span class="span-style">*</span>字典名称:</label>
                        <div class="col-lg-3">
                            <input class="form-control form-fields" type="text" maxlength="64" [(ngModel)]="editOrAddDictionaryPost.sItemDec" name="sItemDec">
                        </div>
                        <label class="col-lg-2 text-right">
                            <span class="span-style">*</span>字典值:</label>
                        <div class="col-lg-3">
                            <input class="form-control form-fields" type="text" maxlength="64" [(ngModel)]="editOrAddDictionaryPost.sItemValue" name="sItemValue">
                        </div>
                    </div>
                    <div class="form-group">
                        <label class="col-lg-2 text-right">
                            <span class="span-style">*</span>字典值编码:</label>
                        <div class="col-lg-3">
                            <input class="form-control form-fields" type="text" maxlength="64" [(ngModel)]="editOrAddDictionaryPost.sItemKey" name="sItemKey">
                        </div>
                    </div>
                    <div class="form-group">
                        <label class="col-lg-2 text-right">备注:</label>
                        <div class="col-lg-8">
                            <textarea class="form-control form-fields" type="text" maxlength="250" [(ngModel)]="editOrAddDictionaryPost.sRemark" name="sRemark">
                            </textarea>
                        </div>
                    </div>

                </div>
                <div class="modal-footer">
                    <button type="button" class="btn btn-default pull-left" data-dismiss="modal">关闭</button>
                    <button type="button" class="btn btn-primary" *ngIf="ifEdit == 1" (click)="addDictionary()">保存</button>
                    <button type="button" class="btn btn-primary" *ngIf="ifEdit == 2" (click)="editDictionary()">保存</button>
                </div>
            </form>
        </div>
        <!-- /.modal-content -->
    </div>
    <!-- /.modal-dialog -->
</div>